import {
  getDepAreaList,
  getListByAreaName,
  getItemList,
  getModalityTypeList
} from '@/api/api'
// import { isNull } from '@/utils/utils'
// import store from '@/store'
// 获取院区
export function getListByAreaNameFunc(params) {
  return new Promise(resolve => {
    getListByAreaName(params).then(res => {
      if (res && res.code === 10000 && res.content) {
        const _list = res.content.list
        resolve(_list)
      }
      resolve([])
    })
  })
}
// 获取影像区域
export function getDepAreaListFunc(params) {
  return new Promise(resolve => {
    getDepAreaList(params).then(res => {
      if (res && res.code === 10000 && res.content) {
        const _list = res.content.list
        resolve(_list)
      }
      resolve([])
    })
  })
}
// 获取数字词典
export function getItemListFunc(params) {
  return new Promise(resolve => {
    getItemList(params).then(res => {
      // console.log('getItemListres', res)
      if (res && res.code === 10000 && res.content) {
        const _list = res.content.list
        resolve(_list)
      }
      resolve([])
    })
  })
}
// 设备类型
export function getModalityTypeListFunc(params) {
  return new Promise(resolve => {
    getModalityTypeList(params).then(res => {
      if (res && res.code === 10000) {
        resolve(res.content.list)
      }
      resolve([])
    })
  })
}